package org.example.studyonline.controller;

import jakarta.annotation.Resource;
import org.example.studyonline.pojo.Result;
import org.example.studyonline.service.ChapterService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/chapter")
public class ChapterController {

    @Resource
    private ChapterService chapterService;

    //获取指定章节的课程资料信息
    @GetMapping("/materials/{chapterID}")
    public Result getMaterials(@PathVariable Integer chapterID){
        return Result.success("获取课程资料成功",chapterService.getMaterials(chapterID));
    }
}
